// JavaScript Document
$(document).ready(function() {
	var original = $("#tabstrip").clone(true);
	original.find(".k-state-active").removeClass("k-state-active");

	var initTabStrip = function () {
		$("#tabstrip").kendoTabStrip({ animation: { open: { effects: "expand:vertical " } } }).css({ marginRight: "0px" });
	};

	$(".configuration input").change( function() {
		var tabStrip = $("#tabstrip"),
			selectedIndex = tabStrip.data("kendoTabStrip").select().index(),
			clone = original.clone(true);

		clone.children("ul")
			 .children("li")
			 .eq(selectedIndex)
			 .addClass("k-state-active")
			 .end();

		tabStrip.replaceWith(clone);

		initTabStrip();
	});

	initTabStrip();
});